package com.fxm.controller;

import com.fxm.returns.RespEntity;
import com.fxm.service.WeChartService;
import com.fxm.vo.param.UserParam;
import com.fxm.vo.result.SessionResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 微信平台数据对接 前端控制器
 * </p>
 *
 * @author fxm
 * @since 2020-12-29
 */
@RestController
@RequestMapping("/we-chart")
@Slf4j
@Api(value = "微信平台数据对接", tags = "微信平台数据对接")
public class WeChartController {

    @Resource
    private WeChartService weChartService;

    @PostMapping("/login")
    @ApiOperation(value = "登陆接口")
    public RespEntity<SessionResult> login(@RequestBody UserParam userParam) {
        RespEntity<SessionResult> respEntity = weChartService.getSession(userParam);
        return respEntity;
    }

}
